﻿/*
 * @Autor: PK
 * @Date: 2022/01/15 10:46:SS
 */

using System;
using System.Collections.Generic;

namespace ShkSimulation.core.template.customer {

	public class LambdaDemandManager: DemandManager {
		
		public LambdaDemandManager(Func<NetworkInputData, List<CustomerTemplate>> func) {
			this.templateCreateFunction = func;
		}

		private Func<NetworkInputData, List<CustomerTemplate>> templateCreateFunction;
		
		public override List<CustomerTemplate> InitializeCustomerTemplate(NetworkInputData environment) {
			return templateCreateFunction(environment);
		}

		public override DemandManager Clone() {
			return new LambdaDemandManager(templateCreateFunction);
		}

		public static DemandManager Create(Func<NetworkInputData, List<CustomerTemplate>> func) {
			return new LambdaDemandManager(func);
		}

	}

}